package com.tisson.action;

import com.tisson.dao.AdminDAO;
import com.tisson.pojo.Admin;

public class EditpwAction extends ActionSup{
	private String username;
	private String password;
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String edit(){
		AdminDAO adminDao = new AdminDAO();
		Admin admin = adminDao.findByUsername(username);
		admin.setPassword(password);
		adminDao.update(admin);
		request.getSession().setAttribute("password", password);
		return "success";
	}
}
